<template>
	<view class="content">
		<!-- 标题 -->
		<view class="title">{{ message.name }}</view>
		<!-- 时间 -->
		<view class="time">{{ message.addtime_text }}</view>
		<!-- 内容 -->
		<rich-text class="text" :nodes="message.content"></rich-text>
		<!-- <view class="text" v-html="message.content"></view> -->
	</view>
</template>
<script>
export default {
	data() {
		return {
			id: 0,
			message: {}
		};
	},
	onLoad(option) {
		this.id = option.id;
		this.loadData();
	},
	methods: {
		// 获取接口返回的数据
		loadData() {
			const param = {
				id: this.id
			};
			this.$http.request('Index', 'articledetail', 'GET', param, (res) => {
				if (res.status == 1) {
					if (res.data.error == 0) {
						this.message = res.data.data;
					}
				}
			});
		},
	}
};
</script>

<style lang="scss" scoped>
page {
	background-color: #ffff;
}

.content {
	background-color: #ffff !important;
	padding: 10upx 20upx;
	
	.title{
		line-height: 50upx;
		font-size: 30upx;
		font-weight: bold;
	}
	
	.time{
		line-height: 50upx;
		font-size: 24upx;
		color: #909399;
		border-bottom: solid #D6D6D6 2upx;
	}
	
	.text{
		padding: 20upx 0upx;
	}
	
}
</style>
